/*
 * Copyright 2008-2012 Centro Andaluz de Innovación y Tecnologías de la
 * Información y las Comunicaciones (CITIC). All Rights Reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
 *
 * Please contact CITIC - Edificio CITIC, C/ Marie Curie, 6 Parque
 * Tecnológico de Andalucía 29590 - Campanillas, Málaga, Spain
 * or visit www.citic.es, if you need additional information or
 * have any questions.
 */
package es.citic.puedes.youtube;

import java.util.List;


/**
 * interface that provides the functionality of the Preference module
 * 
 * 
 */
public interface IYouTubeUserModel {

	/**
	 * update the database with the current preference model of the user with
	 * the keywords of the videos and the visit,like and dislike counts
	 * 
	 * @throws YouTubeException if any error in the BBDD appears
	 */
	void saveUserModel() throws YouTubeException;

	/**
	 * sets the preferences of an user. Update the visit count for this keywords
	 * on memory. For updating the preferences on the BBDD, the method
	 * saveUserModel must be called
	 * 
	 * @param keywordList
	 *            keyword list from a video to set as preference
	 * @throws YouTubeException if any error in the BBDD appears
	 */
	void setKeywordSelection(List<String> keywordList) throws YouTubeException;

	/**
	 * marks the preferences of an user. Update the like and dislike count for
	 * this keywords on memory. For updating the preferences on the BBDD, the
	 * method saveUserModel must be called
	 * 
	 * @param keywordList
	 *            keyword list from a video to mark as preference
	 * @param hasLiked
	 *            true if the video has liked, false in another case
	 * @throws YouTubeException if any error in the BBDD appears
	 */
	void setKeywordEvaluation(List<String> keywordList, boolean hasLiked)
			throws YouTubeException;

	/**
	 * gets the preferences of the user
	 * 
	 * @return a Preference object list with the preferences of the user
	 */
	List<Preference> getKeywordPreference();

}
